The DataCodecCompress function compresses data using the specified compressor component.
pascal ComponentResult DataCodecCompress (
DataCodecComponent dc,
void *srcData,
UInt32 srcSize,
void *dstData,
UInt32 dstBufferSize,
UInt32 *actualDstSize,
UInt32 *decompressSlop );
Before calling the DataCodecCompress function, you should call the DataCodecGetCompressBufferSize function to obtain the maximum possible size of the compressed data that will be returned. You can then use this value as the value of the dstBufferSize parameter. Note that a buffer for compressed data that is the same size as the uncompressed data may not be large enough: in some cases, the size of the compressed data can be larger than the size of the decompressed data.
When you compress data, you should store the size of data before compression at the beginning of the file, immediately before the compressed data. This allows you to obtain the size of the decompressed data and allocate the buffer for storing the decompressed data before calling the DataCodecDecompress function.
You can compress sprites by calling the DataCodecCompress function. If you do, you must
You can compress 3D media samples by calling the DataCodecCompress function. If you do, you must
The DataCodecDecompress function decompresses data using the specified compressor component.
pascal ComponentResult DataCodecDecompress (
DataCodecComponent dc,
void *srcData,
UInt32 srcSize,
void *dstData,
UInt32 dstBufferSize );
| Previous | Chapter Contents | Chapter Top | Next |